<?php

	include 'connect/connect.php';
    header("Content-type: text/xml; charset=ISO-8859-1");
    $name = $_GET['name'];
    
    $xml = "<select name=\"".$name."\" id=\"".$name."\">";

    $result = mysql_query("SELECT * FROM cidade 
    					   WHERE estado_idestado = '{$_GET['estado']}' 
    					   ORDER BY descricao",$link);

    while ($row = mysql_fetch_array($result)) {
        $xml = $xml."<option value=\"".$row['idcidade']."\">".$row['descricao']."</option>\n";
    }
    
    $xml = $xml.'</select>';

    mysql_close($link);
 	
 	echo $xml;

 ?>